package chapter8

import org.apache.spark.streaming.dstream.DStream
import org.apache.spark.streaming.{Seconds, StreamingContext}
import org.apache.spark.{SparkConf, SparkContext}

object HDFSFileStreaming {


  val conf: SparkConf = new SparkConf().setAppName(this.getClass.getName)

  val sc = new SparkContext(conf)

  val ssc = new StreamingContext(sc, Seconds(5))


  private val fileData: DStream[String] = ssc.textFileStream("hdfs://hadoop001:9000/directory")

  fileData.print()

  ssc.start()
  ssc.awaitTermination()



}
